/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/* The old iframe auto height */
function SetCwinHeight(){
    var idname=document.getElementById("idname"); //iframe 的id名称
    idname.height = "10px";
    if (document.getElementById){
        if (idname && !window.opera){
            if (idname.contentDocument && idname.contentDocument.body.offsetHeight){
                idname.height = idname.contentDocument.body.offsetHeight;
            }else if(idname.Document && idname.Document.body.scrollHeight){
                idname.height = idname.Document.body.scrollHeight;
            }
        }
    }
}

/* The two div auto height */
window.onload=window.onresize=function(){
    if(document.getElementById("left").clientHeight<document.getElementById("right").clientHeight){
        document.getElementById("left").style.height=document.getElementById("right").offsetHeight+"px";
    }
    else{
        document.getElementById("right").style.height=document.getElementById("left").offsetHeight+"px";
    }
}

/* The iframe auto height */
function reinitIframe(){
    var iframe = document.getElementById("mainFrame");
    try{
        var bHeight = iframe.contentWindow.document.body.scrollHeight;
        var dHeight = iframe.contentWindow.document.documentElement.scrollHeight;
        var height = Math.max(bHeight, dHeight);
        iframe.height = height;
    }catch (ex){}
}
window.setInterval("reinitIframe()", 200);




